/* Jutsu
 * Super class that describes a Jutsu, or successful combo
 *
 * Last Modified: 28.11.2013
 * Author: Guilherme S.G.
 */

#ifndef __JB_JUTSU_H__
#define __JB_JUTSU_H__

#include "Global.h"
#include "HandSeal.h"
#include "ObjectRenderable.h"

typedef enum{EARTH, FIRE, SHADOW, THUNDER, WATER, WIND, WOOD} NATURE_ELEMENT;

class Jutsu
{
protected:
    std::string name;
    std::vector<HandSeal*> seals;
    Sprite *attack;
    double damage;
    NATURE_ELEMENT element;
    
public:
    Jutsu(std::string name_)
    {
        name = name_;
    }
    
    virtual ~Jutsu() {}
    
    virtual std::string getName()           {return name;}
    virtual double getDamage()              {return damage;}
    virtual NATURE_ELEMENT getElement()     {return element;}
    
    virtual void addAnimation(Sprite *animation_)
    {
        attack = animation_;
    }
    
    virtual Sprite* getAnimation()  {return attack;}
    
    virtual void addSeal(HandSeal *seal_)
    {
        seals.push_back(seal_);
    }
    
    virtual void setPosition(double positionX_, double positionY_)
    {
        attack->setPosition(positionY_, positionY_);
    }
    
    virtual bool checkCombo(std::vector<HandSeal*> stack_)
    {
        if(stack_.size() < seals.size())
            return false;
        
        unsigned long int tip = stack_.size()-1;
        for(int i = 0; i < seals.size(); i++)
        {
            if(stack_[tip-i]->getName().compare(seals[i]->getName()) != 0)
                return false;
        }
        
        return true;
    }
};

#endif
